package com.user.query.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.user.query.dao.UserMapper;
import com.user.query.model.User;
import com.user.query.service.UserService;
import com.user.query.utils.Page;
@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserMapper userMapper;
	@Override
	public User getUserByAccountNoAndPsw(String accountNo, String psw)
			throws Exception {
		return userMapper.getUserByAccountNoAndPsw(accountNo, psw);
	}
	@Override
	public void insert(User user) {
		userMapper.insert(user);
	}
	@Override
	public User findByAccountNo(String accountNo) {
		return  userMapper.selectByAccountNo(accountNo);
	}
	@Override
	public void updateByPrimaryKeySelective(User user) {
		userMapper.updateByPrimaryKeySelective(user);
	}
	@Override
	public User selectByPrimaryKey(String userId) {
		return userMapper.selectByPrimaryKey(userId);
	}
	@Override
	public void updatePsw(String userId, String newPsw) throws Exception {
		userMapper.updatePswById(userId, newPsw);
		
	}
	@Override
	public List<User> selectManagerUsers(String isCity,String keyWord, Integer status,
			Page page) {
		//status标识用户是否启用 对应isDel
		return userMapper.selectManagerUsers(isCity,keyWord,status,page);
	}
	@Override
	public int countManagerUsers(String isCity,String keyWord, Integer status, Page page) {
		//status标识用户是否启用 对应isDel
		return userMapper.countManagerUsers(isCity,keyWord,status,page);
	}


}
